There has been proposed an apparatus that calculates the density of an object included in an input image. For example, there is known a technique that learns a random forest representing the association between the feature amount of a partial image and the object density data of the partial image. This technique uses this random forest to measure the object density of the input image. Additionally, there is known a technique that detects a part of the person included in the input image. This technique calculates the number of persons included in the input image from a detection result.
However, in the technique that learns the random forest, the data volume of the object density data is large. Accordingly, the density calculation requires an enormous memory capacity. In the technique that detects a part of the person, the detection accuracy is decreased as the object such as the person included in the input image becomes smaller, or as the input image includes a larger overlap. Accordingly, with the conventional techniques, it is not possible to perform the density calculation with high accuracy and low memory capacity.